1. Field of the Invention
The present invention relates to a method and an apparatus for processing image data, a storage medium and a program, which are designed to convert digital image data obtained by an input device such as a digital still camera into optimal image data to be displayed on a display, or printed by a printer.
2. Description of the Related Art
With improved performance and popularization of an input device such as a digital still camera in recent years, digitization of a photographic image has become easier, increasing chances of treating photographic images as digital data especially on personal computers. Moreover, the photographic images can now be processed and edited by using a variety of application software on such personal computers.
On the other hand, a full-color hardcopy technology has been rapidly developed. Especially, in a printing technology based on an ink jet system, by a technology for reducing a granulation state of ink dots, a quality of a printed image has been becoming equal to that of a silver salt photograph, and its relatively simple printing method has come into wide use.
Image data fetched by the input device such as a digital still camera are recorded in various signal forms and formats by predetermined storing means.
In the case of the digital still camera, most images are recorded in JPEG formats, and the images are stored in forms of luminance and color-difference data (YCbCr data).
A generally used data form is RGB data, and a relation between the RGB data and the YCbCr data is represented by the following equations compliant with ITU-R BT. 601.Y=0.299×R+0.587×G+0.114×BCb=(−0.299×R−0.587×G+0.886×B)×0.564+kCr=(0.701×R−0.587×G−0.114×B)×0.564+k  (Equation 1-1)R=Y+((Cr−k)×1.4020)G=Y−((Cb−k)×0.3441)−((Cr−k)×0.7139)B=Y+((Cb−k)×1.7718)  (Equation 1-2)
Here, Cb and Cr take positive and negative values, and the RGB data is generally processed with 8 bits for each color. Accordingly, in the case of calculation based on 8 bits, R, G and B take 0 to 255 values, and a value of k is 128.
Further, in the case of conversion from the YCbCr data to the RGB data, R, G and B data may take values other than 0 to 255. Thus, saturation processing is carried out to clip a value equal to/lower than 0 to 0, and a value equal to/higher than 255 to 255.
Therefore, in displaying of image data on a display device such as a CRT monitor, only colors represented by data having RGB color values set in the range of 0 to 255 are reproduced.
As color space used for color matching, sRGB color space (IEC 61966-2-1, and ITU-R BT. 709) is available. This sRGB color space is defined buy considering a characteristic of the CRT monitor.
Unification of colors among devices has promoted use the sRGB color space as standard color space of a versatile operation system used on the personal computer. Thus, RGB color values of 0 to 255 have generally been treated as sRGB color space date recently.
However, in a real scene, a color reproducing area is naturally larger than that of the display device such as a CRT monitor. Depending on a part of the color space, a color reproducing area on a printer device may be larger than that on the display device such as a CRT monitor.
FIG. 6 is a chromaticity view showing color reproduction. A reference numeral 601 denotes sRGB color space, and 602 an optional color point to be reproduced.
The sRGB color space frequently used as standard color space is not always included completely within a color reproducing range of an input/output device. As can be understood from FIG. 6, if processing is carried out as sRGB data, a color area to be reproduced by the printer is omitted.
In the digital still camera, a color signal obtained by a sensor is mapped on sRGB space by predetermined processing, and converted into YcrCb data. However, in order to improve color reproducibility other than on the sRGB display device, a value of sRGB data may be equivalently expanded to a value of 0 or lower, or a value of 255 or higher. In this case, a largest color area is decided by limitation (0≦Y≦255, and −128≦CbCr≦127) of an 8-bit YCbCr signal. A color reproducing area may be expanded to this range.
As described above, when Y, Cb and Cr image data used in the JPEG formats are converted into sRGB color space, a color to be reproduced by the printer may be omitted. In the case of an output to the display device such as a CRT monitor, only its color reproducing area can be reproduced originally. Accordingly, a good image without any defects seems to be reproduced. However, in the case of a printed output by the printer, because of omission of information regarding a color contained in an original image, correct color reproduction true to the original image cannot be achieved.
On the other hand, if image data is processed by using expanded color space 603 of FIG. 6, which completely includes the color reproducing range of the printer, correct displaying cannot be carried out in the case of an output to the display device such as a CRT monitor.
The present invention was made with the foregoing problems in mind, and objects of the invention are to provide a method and an apparatus for processing image data, a storage medium and a program, which can output image data after conversion into color space data suitable for outputting means when the image data is outputted.
Objects of the present invention are to provide a method and an apparatus for processing image data, a storage medium and a program, which can achieve conversion into image data suitable for both of a display and a printer.
Further objects of the present invention are to provide a method and an apparatus for processing image data, a storage medium and a program, which can achieve conversion into image data of a proper color reproducing area by analyzing information added to an image file.